Skip to content

paddle/joystick improvements, add Apple II support#243

Merged
sehugg merged 12 commits into
sehugg:masterfrom
fredsa:joystickfix
Mar 25, 2026
Merged

paddle/joystick improvements, add Apple II support#243
sehugg merged 12 commits into
sehugg:masterfrom
fredsa:joystickfix

Conversation

@fredsa

@fredsa fredsa commented Mar 22, 2026

Copy link
Copy Markdown
Contributor
  • Add paddle/joystick support to Apple II platform
    • Paddles or joystick X/Y from mouse cursor position
    • SW0, SW1, SW2 via mouse click, shift-click and alt-click
    • Load/save paddle state
    • Add emucontrols-apple2 help in index.html
  • Add Paddles/Joystick sample for Apple II platform
  • Improve mouse Canvas calculations
    • Improve mouse cursor alignment to emulator content by using
      Canvas content coordinates, ignoring borders and padding
    • Make hitting min/max paddle/joystick values easier by equalizing
      number of screen pixels for these values, and having borders
      and padding capture mouse events for these values
  • Start paddles positions in the center, 128 in range [0,255]
  • Set crosshair cursor on emulator

fredsa added 12 commits March 23, 2026 18:30
Fix mouse cacluations to account for non-integer
canvas scale, and rect posistion & size, and
replace Math.floor() with Math.round(). Fixes
- Unreachable max x/y value in some cases.
- Disproportionate number of mouse pixels
   for min and max mouse positions.
Ignore canvas borders and padding. This has
the nice benefit that it's much easier to land
on min/max mouse x/y, especially when moving
the mouse quickly.
Values remain centered until mouse move events are received.
@sehugg sehugg merged commit 6ce80f9 into sehugg:master Mar 25, 2026
1 check failed
@sehugg

sehugg commented Mar 25, 2026

Copy link
Copy Markdown
Owner

Fun! Like using a light pen :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants